# -*- coding: UTF-8 -*-

from bs4 import BeautifulSoup
from RequestsUtil import *

# 获取BeautifulSoup对象
def getBS(url):
    """
    获取BeautifulSoup对象
    :param url: 需要请求的url
    :return: BeautifulSoup对象
    """
    bs = BeautifulSoup(getRequest(url).text, 'html.parser')
    return bs

# 使用代理获取BeautifulSoup对象
def getBSByProxy(url):
    """
    使用代理获取BeautifulSoup对象
    :param url: 需要请求的url
    :return: BeautifulSoup对象
    """
    bs = BeautifulSoup(getRequestByProxy(url).text, 'html.parser')
    return bs